package com.jing.product.service.impl;

import com.jing.product.domain.PmsBrand;
import com.jing.product.domain.po.PmsProductAttributePO;
import com.jing.product.domain.vo.PmsProductAttributePoVO;
import com.jing.product.mapper.ProductAttributeMapper;
import com.jing.product.mapper.ProductBrandMapper;
import com.jing.product.service.ProductAttributeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductAttributeServiceImpl implements ProductAttributeService {
    @Autowired
    private ProductAttributeMapper productAttributeMapper;

    @Override
    public List<PmsProductAttributePoVO> findAttribute() {
        productAttributeMapper.findAttribute();
        return null;
    }

    @Override
    public void delect(String id) {
        Integer delect = productAttributeMapper.delect(id);
        if(delect<=0){
            throw new RuntimeException("删除失败，请联系管理员");
        }
    }

    @Override
    public void add(PmsProductAttributePO productAttribute) {
        Integer add = productAttributeMapper.add(productAttribute);
        if(add<=0){
            throw new RuntimeException("添加失败，请联系管理员");
        }
    }

    @Override
    public void update(String id) {
        Integer update = productAttributeMapper.update(id);

        if(update<=0){
            throw new RuntimeException("修改失败，请联系管理员");
        }
    }
}
